/**
	The class alloc a console to game,
	and let stdout point to this console.
	Then we can use cout(),printf() print log to that console.
*/

#ifndef	_DEMO_CONSOLE_LOG_H__
#define	_DEMO_CONSOLE_LOG_H__

#include<Windows.h>
#include<iostream>
using namespace std;

class DEMOConsoleLog
{
private:
	FILE*	consoleLog;
public:
	DEMOConsoleLog()
	{
		consoleLog = NULL;
		AllocConsole();
		consoleLog = freopen("CONOUT$","w+t",stdout);
	}

	~DEMOConsoleLog()
	{
		fclose(consoleLog);
	}
};
#endif